ajDBType function
Description
The ajDBType function returns the database type of a given data source ID. The supported database types are Oracle, MySQL, PostgreSQL and MSSQL. Please take note that to run this function from Excel, you would need to create a new data source record in the data source configuration table in External Resources Definition.
Syntax
ajDBType(data_source_id)
Argument Name | Argument Type | Description |
---|---|---|
data_source_id (Optional) | String | The data_source_id. If the data_source_id is not provided, it will use the default data source ID value "primary" in the Data Source Configuration table. |
The function will return:
1) Return Value: Data source type in String format.
2) Return Type: Single Value
Example
In the External Resources Definition, create a new data source record in the Data Source Configuration table.
As you can see, a new data source record is created as shown above. The default data source ID value is "primary". The rest of the columns that are not shown in this screenshot are empty.
Since the data source ID is "primary", it is used as the input parameter of the ajDBType function. This function returns the result 'MySQL'.
Click here to download the use case workbooks for further reference.
Error Scenarios
It will return #VALUE! when missing any required parameter or mismatch parameter type. Besides, system will raise error for below scenario(s).
Error Scenario |
---|
Invalid data source id. |
External Resource Worksheet does not exist. |